package com.cryrabbit.yyystitp.ui.presenters;

import com.cryrabbit.yyystitp.net.LoginHttpMethods;
import com.cryrabbit.yyystitp.ui.iviews.Iview;

import rx.Subscriber;

/**
 * Created by CryRabbit on 2016/8/30.
 */

public class LoginPresenter {
    Iview iview;
    LoginHttpMethods loginHttpMethods;

    public LoginPresenter(Iview iview){
        this.iview=iview;
        loginHttpMethods=new LoginHttpMethods();
    }
    public void login(String user,String password){
        loginHttpMethods.getNet(new Subscriber<String>() {
            @Override
            public void onCompleted() {

            }

            @Override
            public void onError(Throwable e) {

            }

            @Override
            public void onNext(String s) {
                iview.getResult(s);
            }
        },user,password);
    }

}
